package com.demo.order.feign.fallback;

import com.demo.order.feign.ProductFeignClient;
import com.demo.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    @Override
    public Product getProductById(Long id, String token) {
        System.out.println("兜底回调");
        Product product=new Product();
        product.setProductName("未知商品");
        product.setId(-1L);
        product.setNum(-1);
        product.setPrice(new BigDecimal(0));
        return  product;
    }
}
